﻿using B.S.XZYData.Domain.BaseEntities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.XZYData.Domain.RBAC
{
    /// <summary>
    /// 权限实体Model
    /// </summary>
    [SugarTable("PermissionModel")]
    public class PermissionModel : BaseEntity
    {
        /// <summary>
        /// 权限名称
        /// </summary>
        [SugarColumn(ColumnName = "PermissionName", Length = 100, IsNullable = false)]
        public string PermissionName { get; set; } = string.Empty;
        
        /// <summary>
        /// 权限路由
        /// </summary>
        [SugarColumn(ColumnName = "PermissionURL", Length = 200, IsNullable = true)]
        public string? PermissionURL { get; set; } 
        
        /// <summary>
        /// 父级权限
        /// </summary>
        [SugarColumn(ColumnName = "ParentId", IsNullable = false)]
        public int ParentId { get; set; }
        
        /// <summary>
        /// 序号
        /// </summary>
        [SugarColumn(ColumnName = "Number", IsNullable = false)]
        public int Number { get; set; }
        
        /// <summary>
        /// 父级权限名称（非数据库字段，用于显示）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ParentName { get; set; } = string.Empty;
    }
}
